﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Sql;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class User_OrderList : System.Web.UI.Page
{
    DataTable dtOrderList;
    CommonClass ccObj = new CommonClass();
    protected void Page_Load(object sender, EventArgs e)
    {
        // 获取所有ID号为Request.Params["orderID"]的订单明细表
        int orderID = Int32.Parse(Request.Params["orderID"]);
        OrderList orderlist = new OrderList();
        dtOrderList = orderlist.GetOrderListByOrderID(orderID);

        /*if (有订单)
        {
            BindShoppingCart();
        }
        else
        {
            Response.Write(ccObj.MessageBox("您的订单为空！", "Default.aspx"));
            this.DeliveryView.Visible = false;
            this.btnOK.Visible = false;
        }
         */
    }
    private void BindShoppingCart()
    {
        DataTable dtDelivery = new DataTable();
        //将查询到的表dtDelivery数据绑定到DeliveryView中。
        this.DeliveryView.DataSource = dtDelivery;
        this.DeliveryView.DataBind();
    }
    protected void DeliveryView_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        DeliveryView.PageIndex = e.NewPageIndex;
        this.BindShoppingCart();
    }
    protected void btnOK_Click(object sender, EventArgs e)
    {
        Response.Redirect("Default.aspx");
    }
}
